

const asyncSetInterval = async (fn, time = 200) => {
  return new Promise((resolve, reject) => {
    let timer = setInterval(() => {
      let result = fn();
      if (result) {
        clearInterval(timer);
        timer = null;
        resolve(result);
      }
    }, time);
  });
};
// 保存明细表
const saveTableDetail = (tableContent) => {
  window.postMessage(
    {
      event: 'asyncTableDetail',
      data: tableContent
    },
    '*'
  );
};


export {
  asyncSetInterval,
  saveTableDetail
};
